<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/1/13
 * Time: 20:46
 */
define("PHP_IN",true);
require "include/init.php";
$username = isset($_GET['username']) ? $_GET['username']:"";

$sql = "SELECT * FROM user WHERE username='$username'";
$result = $db->query($sql);
if($result && mysql_num_rows($result)){
    echo "用户名已存在";
}else{
    echo "此用户名有效";
}